<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">

    <a :href="url">哈哈</a>
    <a :[key]="url">哈哈</a>

    <a @click="doSomething">哈哈</a>
    <a @[event]="doSomething">哈哈</a>
</div>


<script src="../js/vue.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            url: 'https://www.baidu.com',
            key: 'href',
            event: 'click'
        },
        methods: {
            doSomething(){
                console.log('哈哈!')
            }
        }
    })
</script>
</body>
</html>